<?php
namespace app\thread\controller;
use think\Controller;
use app\thread\model\Thread as ThreadModel;
use think\Db;
class Insert extends Controller {
   function index(){
       $first_time=date("Y-m-d H:i:s");
       $last_time=$first_time;
       $m_id=12;
       $name="guest";
       for ($i=0;$i<=10000;$i++){
           $title=$i."标题-习近平视察南部战区陆军机关";
           $context=$i."内容-习近平视察南部战区陆军机关";
           $res=new ThreadModel();
           $res->data([
              'm_id'=>12,
               'title'=>$title,
               'context'=>$context,
               'name'=>$name,
               'first_time'=>$first_time,
               'last_time'=>$last_time
           ]);
           $res->save();
       }
   }
    function reply(){
        $first_time=date("Y-m-d H:i:s");
        $last_time=$first_time;
        $z_id=10021;
        $name="guest";
        for ($i=0;$i<=10000;$i++){
            $context=$i."帖子回复";
            Db::name('reply')->insert(['context'=>$context,'name'=>'guest','first_time'=>$first_time,'last_time'=>$last_time,'z_id'=>$z_id]);
        }
    }
}

